package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpTicketSlaMinderPageUtil extends SeleniumPageUtil{
	
	public final static By SLAMINDER_LINK_IMG_CHART = By.id("ctl44_Chart1_Chart1");
	public final static By SLAMINDER_UN_ASSIGN = By.xpath("//*[@id='ctl44_Chart1_Chart1ImageMap']/area[10]");
	public final static By SLA_SPAN_HEAD = By.id("ctl44_SlaMinder_Header_lblHeader");
	//*[@id='ctl44_SlaMinder_ReportOutput']/table/tbody/tr[3]/td[1]
	
	
	public final static By SLA_TH_DATE = By.id("ctl44_SlaMinder_sort_5");
	public final static By SLA_TD_DATE_DATA = By.xpath("//*[@id='ctl44_SlaMinder_ReportOutput']/table/tbody/tr/td[5]");
	public final static By SLA_TD_FIRST_RECORD = By.xpath("//*[@id='ctl44_SlaMinder_ReportOutput']/table/tbody/tr[3]/td[1]");
	public final static By SLA_IMG_FILTER_1 = By.id("ctl44_SlaMinder_filter_1");
	public final static By SLA_INPUT_INCIDENT_NUMBER = By.id("ctl44_SlaMinder_txtFilterInput");
	public final static By SLA_BUTTON_ENTER = By.id("ctl44_SlaMinder_btnFilterEnter");
	public final static By SLA_IMG_EXPORT = By.id("ctl44_SlaMinder_Header_imgExcelExport");
	public final static By SLA_IMG_REFRESH = By.id("ctl44_SlaMinder_Header_imgRefresh");
	

	public static void enteTicketSlaMinderPage(){
		SpHomePageUtil.enter();
		SpHomePageUtil.enterTicketSlaMinderPage();
	}
	
	public static void waitForPageToLoad() {
		// SLA Minder page in content area
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{SLAMINDER_LINK_IMG_CHART});
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(SLAMINDER_LINK_IMG_CHART));
	}
	
	public static void waitForPanelToLoad() {
		SeleniumUtil.waitOnElements(new By[]{
				SLA_IMG_FILTER_1, SLA_IMG_EXPORT
				});
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(SLA_IMG_FILTER_1));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(SLA_IMG_EXPORT));
	}
}
